require 'zlib'

class BloggerCrawl < ActiveRecord::Base
  has_many :blogspot_crawls
  has_one :blogger_data, :foreign_key => :crawl_id
  
  def body
    Zlib::Inflate.inflate super
  end
  
  def body=(new_body)
    super Zlib::Deflate.deflate new_body.to_s  
  end
  
  
  def data
    self.blogger_data
  end
  
  def data=(new_data)
    self.create_blogger_data = new_data
  end
  
  def create_data(args = {})
    create_blogger_data args
  end
  
end
